home *** CD-ROM | disk | FTP | other *** search
/ Aminet 2 / Aminet AMIGA CDROM (1994)(Walnut Creek)[Feb 1994][W.O. 44790-1].iso / Aminet / gfx / misc / lise20.lha / lise2.0 / mdl / src / mdl.doc < prev    next >
Text File  |  1993-03-31  |  7KB  |  157 lines

  1. Documentation for the
  2.  
  3.       Menu Description Language  Interpreter
  4.       -    -           -
  5.  
  6.       (c) 1990 by Rainer Kowallik
  7.  
  8.  
  9. What is this ?
  10. ______________
  11.  
  12. In principle you can think of mdl as an menu extension to the
  13. Korn Shell for UNIX (and also for the Amiga !)
  14. You need to write a menu description file, which consists of
  15. the names of some menu items, together with assotiated variable
  16. names (as though there where ksh variables) or (inclusive)
  17. ksh commands to be executed.
  18. The commands are executed when the specified button is pressed.
  19. Any known ksh command is valid. Commands may continue on the next line,
  20. and may be separated by a semicolon.
  21. But remember: the whole command is packed into one single string,
  22. NL is replaced by semicolon, and this string is passed to the kshell.
  23. The size of this string should not exceed 8K !
  24.  
  25.  
  26. Menu creation commands:
  27. ________________________
  28.  
  29. x,y are the coordinates of the item. Set these coordinates to -1,-1 if you
  30. want just to have the next available position
  31.  
  32. FACTOR{factor_x,factor_y}                   sets scaling factors
  33.                                             to ease poring scripts
  34.                                             to other workstations
  35.  
  36. SIZE {x,y,inc}                              sets the window size and
  37.                                             y-increment.
  38.                                             MUST be the first command !
  39.  
  40. LANGUAGE{interpreter to execute with options}
  41.                                             sets an alternate execution
  42.                                             interpreter (e.g. csh)
  43.  
  44. STARTUP {"commands"}                        These commands are executeted
  45.                                             before the menu will be
  46.                                             displayed. You may specify
  47.                                             more than 1 STARTUP routine
  48.                                             The startup routines are called
  49.                                             in the correct order and
  50.                                             state of progress.
  51.  
  52. NEW_MENU {"name"}                           creating new entry on menue bar
  53.  
  54. MENU {"name"}{"command_string"}             creating new menu item in
  55.                                             the actual category
  56.  
  57. RADIO                                       subsequent TOGGLE calls are
  58.                                             packed as "radio box"
  59.  
  60. TOGGLE {x,y,"name"}{"variable"}             generates a toggle button
  61.                                             and assigns its value to
  62.                                             the given variable
  63.  
  64. PUSH {x,y,"name"}{"command_string"}         generates a push button and
  65.                                             assignes a command string
  66.                                             to the button, which will be
  67.                                             executed, when the button is
  68.                                             pressed.
  69.  
  70. SCALEX {x,y,"name",min,max}{"variable"}     generates a slider and assigns
  71.      Y                                      its value to the given variable
  72.                                             The size is proprtional to
  73.                                             (max-min) (should be !)
  74.  
  75. SCALEX11 {x,y,"name",min,max}{"variable"}   generates a slider and assigns
  76.      Y                                      its value to the given variable
  77.                                             The size is proprtional to
  78.                                             (max-min) (should be !)
  79.  
  80. STRING_BOX{x,y,"name"}{"variable"}{"command_string"}
  81.                                             creates a single line Text
  82.                                             input field
  83.  
  84. SELECTION{x,y,"name,item1,item2,..."}{"variable"}{"command_string"}
  85.                                             creates a selection box with
  86.                                             given items in its window.
  87.                                             The Variable name is assigned
  88.                                             to its value, and the command
  89.                                             string will be executed when
  90.                                             you hit OK.
  91.  
  92. FILE_SELECT{x,y,"name"}{"variable"}{"command_string"}
  93.                                             creates a file selection box.
  94.                                             The Variable name is assigned
  95.                                             to its value, and the command
  96.                                             string will be executed when
  97.                                             you hit OK.
  98.  
  99.  
  100. Command string parsing:
  101. _______________________
  102.  
  103. When you hit a button, the corresponding commandstring will be parsed in two
  104. steps:
  105.  
  106. 1. It is searched for any '$' string, and the following variable substitution.
  107.    If the variable is found, it will be substituted.
  108.  
  109. 2. The string will pe passed to the Korn-Shell. This allows for any known
  110.    ksh construct to be parsed.
  111.  
  112. The resulting output (if any) will be displayed on a Help window.
  113. If the resulting string is
  114.    "EXIT"         the program exits. This allows you
  115.                   to terminate the program by an "echo EXIT"
  116.                   statement on special conditions.
  117.  
  118.    "CD dir"       the working directory is changed
  119.  
  120.    "SET var val"  the pseudo variable "var" is set to "val" 
  121.                   (only usefull for STRING_BOX types)
  122.  
  123.  
  124. Predifined "variable names":
  125. ____________________________
  126.  
  127. In fact these variables are more like Function calls, since they interact with
  128. the user to return a value.
  129.  
  130. HELP{"string"}                              The string will be displayed in
  131.                                             a help window.
  132.  
  133. STRINGBOX{"title,option"}                   The user is asked to enter a
  134.                                             string. Option is first inserted
  135.  
  136. FILESELECT{"root"}                          A file selection box is called.
  137.  
  138. EXIT                                        exits the program
  139.  
  140.  
  141.  
  142. Resource definition (UNIX only):
  143. ________________________________
  144.  
  145. If the very first character in your file is an open curley bracket {
  146. then the text between this bracket and the corresponding closing bracket }
  147. is copied to /usr/lib/X11/app-defaults/mdl.tmp and handled to the
  148. Toolkit open routines as resource file.
  149.  
  150. Amiga goodies:
  151. --------------
  152. NAME{name}                                  sets the name in the titlebar
  153.                                             sets an alternative Language
  154. SIZE{x,y,inc,top,left}                      can additionally set the window
  155.                                             position
  156.  
  157.